<div>
    <div class="logo">
        <a href="#"><p>wike众包</p></a>
    </div>
    <div>
        <nav>
            <ul>
                <li><a href="{{route('Home')}}" @if(\Request::url() == route('Home'))class="selected" @endif>首页</a></li>
                <li><a href="{{route('Home.Service.createFacilitator')}}" @if(\Request::url() == route('Home.Service.createFacilitator'))class="selected" @endif>认证服务商</a></li>
                <li><a href="{{route('Home.Service.createPop')}}" @if(\Request::url() == route('Home.Service.createPop'))class="selected" @endif>认证推广员</a><em class="hot">HOT</em></li>
                <li><a href="{{route('Home.Auth.about')}}" @if(\Request::url() == route('Home.Auth.about'))class="selected" @endif>关于我们</a></li>
            </ul>
        </nav>
    </div>
    @if(Auth::check())
    <div class="controlCenter">
			<P><a href="{{route('Home.Service.userCenter')}}">管理中心</a></P>
	</div>
    @else
    <div class="logiInfo">
        <a href="{{route('Home.Auth.login')}}">登陆 / </a>
        <a href="{{route('Home.Auth.register')}}">注册</a>
    </div>
    @endif
</div>
<script>
    jQuery(function($){
        jQuery.ajaxSetup({
            case:false,
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        var doc = document,
                $doc = $(doc);
        $doc.on('click','#toUserCenter',function(){
            $.ajax({
                type:"post",
                url:'{{route('Api.Fac.getUserInfo')}}',
                dataType:"json",
                data:{"id":0},
                success:function(obj){
                    if(obj.level == "success"){
                        if(obj.data.state == 0){
                            noty({text:'您还未成为认证服务商，请先完成认证',type:'error',
                                callback:{
                                    afterClose:function(){
                                        window.location.href='{{route('Home.Service.createFacilitator')}}';
                                    }
                                }
                            });
                        }else{
                            window.location.href='{{route('Home.Service.userCenter')}}';
                        }

                    }
                },
                error:function(obj){
                    var datajson = obj.responseJSON;
                    noty({type:datajson.level,text:datajson.message,timeout:600});
                }
            });
        });
    });
</script>